import * as core from './core';
//import log from '../../../log';

module.exports = r => {
    r.get('/:page/:pagesize', ctx => {
        return core.getQuesByUserId(ctx.params.page, ctx.params.pagesize, ctx.request.query, ctx.request.user)
            .then(ctx.done, ctx.fail);
    });
    r.get('/', ctx => core.find(ctx.query).then(ctx.done, ctx.fail));
    r.get('/count', ctx => core.getQueAndQueTempCount(ctx.request.user).then(ctx.done, ctx.fail));
    r.post('/', ctx => core.add(ctx.request.body, ctx.request.user).then(ctx.done, ctx.fail));
};
